Factory automation networks have traditionally utilized proprietary protocols specially designed to facilitate real time coordination between master and slaves. For example, in an automotive application, robots may perform simultaneous operations on a work piece and have to be precisely synchronized in time.
Recently, interest in using Ethernet in factory automation has grown due the inclusion of inexpensive Ethernet Network Interface Cards (NICs) on most personal computers and the low costs of components due to commoditization of Ethernet.
Thus, the need for precise synchronization between slaves has challenged network designers utilizing Ethernet in Factory Automation environment. One effort for meeting this challenge is the IEEE 1588 Standard precision Time Protocol (PTP) which defines a method for sub-microsecond synchronization of the clocks in sensors, actuators, and other terminal devices on a standard Ethernet-based network or other distributed application utilizing commercially available technology.
In PTP each terminal device has a precision clock that provides a local time source. Thus, if a master requires two slave devices to perform actions at time tx, it sends a message to each slave device including the time tx. However, each slave device will perform the action at tx referenced to its local clock. If the clocks on the slaves are not synchronized then the operations will not be performed simultaneously.
PTP utilizes two phases to synchronize the clocks. In the first phase the difference between the master clock and slave clock is corrected without taking transmission delay into account. PTP utilizes two messages to implement this step. First a SYNC message is transmitted by the master at a precise time and the slave records the time of receipt of the message with its local clock. The master then transmits a follow up message that contains the exact time of transmission of the SYNC message according to the master clock. The slave utilizes its recorded time of receipt of the SYNC message and the information in the follow up message so adjust the time indicated by its local clock to be the same as the master clock.
However, the delay introduced by the network has not been compensated so that the master and slave clocks still differ by the delay value. To compensate for this delay, in the second phase the slave sends a delay request message to the master and records the time of transmission based on the slave clock. The master then time stamps the received delay request packet at the time of receipt indicated by the master clock and sends the time stamp to the slave in a delay response message. The slave utilizes the recorded time of transmission of the delay request message and the time stamp to adjust its local clock to compensate for transmission delay.
As is apparent from the above, the PTP synchronization can be no more accurate the uncertainty in the times of transmission of the SYNC and delay request messages. However, in switches, routers, and other network infrastructure devices this time of transmission is difficult to precisely measure during heavy load or overload conditions.
In order to synchronize clocks on two different devices using a network protocol, one has to account for all significant time loss in the network protocol. In the case of a 1588 implementation over TCP/IP on Ethernet, there is time loss in a few areas:                1. A first delay is due to the time it takes a packet prepared to be sent by the 1588 PTP to make it through the TCP/IP stack.        2. A second delay is due to the packet having to wait its turn to be transmitted out of the switch because there are queues in switches        
Accordingly, techniques for implementing PTP on switches, routers, and other network interface structures are the being investigated by engineers working on applying Ethernet to Factory Automation environments.